package com.sam.api.service;

import com.sam.mvp.entity.User;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * @ProjectName: SamLib
 * @Package: com.sam.api.service
 * @ClassName: UserService
 * @Description:
 * @Author: Carl
 * @CreateDate: 2018/10/23 9:30
 * @UpdateUser:
 * @UpdateDate: 2018/10/23 9:30
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public interface UserService {
    String HEADER_API = "Accept: application/vnd.github.v3+json";
    @Headers({HEADER_API})
    @GET("/users")
    Observable<List<User>> getUsers(@Query("since") int sinceNum, @Query("per_page") int perPage);

    @Streaming //大文件时要加不然会OOM
    @GET
    Observable<ResponseBody> downloadFile(@Url String url);
}
